import {
    service
} from '@/utils/request'

//获取所有基金信息
export function getAllFundInfo() {
    return service({
        url: '/fund/getAllFund',
        method: 'get',
    })
}

export function getHistoryNetWorth(fundId) {
    return service({
        url: '/fund/getHistoryNetWorth',
        method: 'get',
        params: {
            fundId,
            startTime: '',
            endTime: ''
        }
    })
}

export function getFundList(fundId, fundName, fundStatus, riskLevel) {
    return service({
        url: '/fund/getFundList',
        method: 'put',
        data: {
            fundId,
            fundName,
            fundStatus,
            riskLevel,
            netWorth: null
        }
    })
}

export function getAllFund() {
    return service({
        url: '/fund/getFundList',
        method: 'put',
        data: {
            fundId: null,
            fundName: null,
            fundStatus: null,
            riskLevel: null,
            netWorth: null
        }
    })
}

export function getUpdateFund(fundId, netWorth, fundStatus) {
    return service({
        url: '/fund/updateFund',
        method: 'put',
        data: {
            fundId,
            fundStatus,
            netWorth,
            riskLevel: null,
            fundName: null
        }
    })
}